<script lang="ts" setup>
import Header from '@/component/Header/index.vue';
import { useRouter } from 'vue-router';
import { useUserStore } from '@/store/user';
import { getUserInfo } from '@/apis';
import { getLocalStorageItem } from '@/utils/storage/localStorage';
import config from '@/config';

const blackList = ['/errorPage'];
const token = getLocalStorageItem(config.userTokenLocal) as string;
const router = useRouter();

await useUserStore()._getPosition();
await useUserStore()._initUserInfo();
// await getUserInfo(token)

</script>

<template>
    <div class="global" v-show="!blackList.includes(router.currentRoute.value.path)">
        <m-progress></m-progress>
        <Header></Header>
        <div class="page">
            <slot></slot>
        </div>
    </div>
    <div class="plugin" v-show="!blackList.includes(router.currentRoute.value.path)">
        <!-- <m-tool-box></m-tool-box> -->
        <m-transition name="backInUp" toggle>
            <m-back-top percent="40"></m-back-top>
        </m-transition>
    </div>
</template>

<style lang="less" scoped>
.global {
    .page {
        // margin-top: 90px;
        width: 100%;
        height: calc(100vh - 90px);
    }
}
</style>